<template>
  <div class="categories">
    <template v-for="(item ,index) in categories" :key="index">
      <div class="item">
        <img class="icon" :src="item.pictureUrl" alt="">
        <div class="title">{{item.title}}</div>
      </div>
    </template>
  </div>
</template>

<script setup>
import useHomeStore from "@/store/modules/home"
import { storeToRefs } from "pinia"

const homeStore = useHomeStore()
const { categories } = storeToRefs(homeStore)
</script>

<style lang="less" scoped>
.categories{
  display: flex;
  margin-top: 10px;
  overflow-x: auto;
  height: 70px;
  &::-webkit-scrollbar {
    display: none;
  }
  .item {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    flex-shrink: 0;
    margin: 0 10px;
    .icon {
      width: 40px;
    }
    .title{
      margin-top: 3px;
      text-align: center;
    }
  }
}
</style>
